<?php
require_once("../resources/commons.php");

/**
 * Check if the user is allowed to connect (= if he/she is superadmin)
 */
function checkAdminRights(){
    if(SessionManager::getInstance()->checkSession()){
    	if(!SessionManager::getInstance()->isSuperAdmin()){
    		displayError("Protected area");
    	}
    }
}

/**
 * Send an invitation to a user so that he/she could complete his/her registration
 * @param string $p_email the user e-mail address
 * @param string $p_profileUpdateKey the long key for the registration script
 */
function sendInvitation($p_email, $p_profileUpdateKey){
	//The registration URL
	$l_profileUpdateUrl=getServerURL(ROOT_PATH . "/apps/register.php?" . PROFILE_UPDATE_KEY . "=" . $p_profileUpdateKey);
	displayTop("Invitation process",null,null);
	?>
	<p>An e-mail has been send to <?=$p_email ?>.</p>
	<p>The user must connect within 48 hours to this <a href="<?=$l_profileUpdateUrl?>">update link</a> to complete the registration process otherwise the account
	will be locked.</p>
	<?php
	displayBottom();
}

?>